<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('category_id')->index()->default(0)->comment('父级ID');
			$table->bigInteger('merchant_id')->index()->default(0)->comment('商户ID');
            $table->string('goods_name',100)->default('')->comment('商品名称');
            $table->string('goods_code',100)->default('')->comment('商品编码');
            $table->string('goods_unit',10)->default('')->comment('商品单位');
            $table->integer('good_num')->default(0)->comment('商品数量');
            $table->string('goods_image',200)->default('')->comment('图片');
            $table->tinyInteger('on_sale')->default(0)->comment('是否上架,1上架,0下架');
            $table->decimal('shop_price')->default(10,2)->comment('销售价');
            $table->string('goods_content',100)->default('')->comment('商品备注');
            $table->tinyInteger('state')->default(1)->comment('是否删除,1.正常,删除');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
